<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>不向后兼容的变更</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="migration55.changes.html">PHP 5.5.x 中的变更</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="migration55.new-features.html">新的特性</a></div>
 <div class="up"><a href="migration55.html">从 PHP 5.4.x 迁移到 PHP 5.5.x</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="migration55.incompatible" class="sect1">
  <h2 class="title">不向后兼容的变更</h2>
  <p class="simpara">
   尽管大部分现有的 PHP 5 代码不需要更改就可以正常运行，但请注意一些不向后兼容的变更：
  </p>
  
  <div class="sect2" id="migration55.incompatible.windows">
   <h3 class="title">不再支持 Windows XP 和 2003</h3>
   
   <p class="para">
    已放弃对 Windows XP 和 2003 的支持。构建 Windows 版本的 PHP 需要 Windows Vista 或更新的系统。
   </p>
  </div>

  <div class="sect2" id="migration55.incompatible.case">
   <h3 class="title">Case insensitivity no longer locale specific</h3>
   
   <p class="para">
    All case insensitive matching for function, class and constant names is
    now performed in a locale independent manner according to ASCII rules.
    This improves support for languages using the Latin alphabet with unusual
    collating rules, such as Turkish and Azeri.
   </p>
   <p class="para">
    This may cause issues for code that uses case insensitive matches for
    non-ASCII characters in multibyte character sets (including UTF-8), such
    as accented characters in many European languages. If you have a
    non-English, non-ASCII code base, then you will need to test that you are
    not inadvertently relying on this behaviour before deploying PHP 5.5 to
    production systems.
   </p>
  </div>

  <div class="sect2" id="migration55.incompatible.pack">
   <h3 class="title"><span class="function"><a href="function.pack.html" class="function">pack()</a></span> 和 <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> 函数的变化</h3>

   <p class="para">
    为使 <span class="function"><a href="function.pack.html" class="function">pack()</a></span> 和 <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> 更兼容 Perl 做了一些变更：
   </p>

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.pack.html" class="function">pack()</a></span> 现在支持“Z”格式代码，其表现的行为与“a”相同。
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> now support the &quot;Z&quot; format code for NULL
      padded strings, and behaves as &quot;a&quot; did in previous versions: it will
      strip trailing NULL bytes.且其行为类似上一个版本中的“a”：清除后面的 NULL 字节。
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> now keeps trailing NULL bytes when the &quot;a&quot;
      format code is used.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> now strips all trailing ASCII whitespace
      when the &quot;A&quot; format code is used.
     </span>
    </li>
   </ul>

   <p class="para">
    Writing backward compatible code that uses the &quot;a&quot; format code with
    <span class="function"><a href="function.unpack.html" class="function">unpack()</a></span> requires the use of
    <span class="function"><a href="function.version-compare.html" class="function">version_compare()</a></span>, due to the backward compatibility
    break.
   </p>
   <p class="para">
    例如：
   </p>
   <div class="informalexample">
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;以前的代码：<br /></span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">unpack</span><span style="color: #007700">(</span><span style="color: #DD0000">'a5'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$packed</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;新的代码：<br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">version_compare</span><span style="color: #007700">(</span><span style="color: #0000BB">PHP_VERSION</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'5.5.0-dev'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'&gt;='</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">unpack</span><span style="color: #007700">(</span><span style="color: #DD0000">'Z5'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$packed</span><span style="color: #007700">);<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">unpack</span><span style="color: #007700">(</span><span style="color: #DD0000">'a5'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$packed</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </div>

  <div class="sect2" id="migration55.incompatible.guid">
   <h3 class="title"> 移除 PHP logo GUIDs </h3>

   <p class="para">
    The GUIDs that previously resulted in PHP outputting various logos have
    been removed. This includes the removal of the functions to return those
    GUIDs. The removed functions are:
   </p>

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.php-logo-guid.html" class="function">php_logo_guid()</a></span>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <span class="function"><strong>php_egg_logo_guid()</strong></span>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <span class="function"><strong>php_real_logo_guid()</strong></span>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.zend-logo-guid.html" class="function">zend_logo_guid()</a></span>
     </span>
    </li>
   </ul>
  </div>

  <div class="sect2" id="migration55.incompatible.execution">
   <h3 class="title">Internal execution changes</h3>

   <p class="para">
    Extension authors should note that the <strong class="command">zend_execute()</strong>
    function can no longer be overridden, and that numerous changes have been
    made to the <em>execute_data</em> struct and related function
    and method handling opcodes.
   </p>

   <p class="para">
    Most extension authors are unlikely to be affected, but those writing
    extensions that hook deeply into the Zend Engine should read
    <a href="migration55.internals.html" class="link">the notes on these changes</a>.
   </p>
  </div>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="migration55.changes.html">PHP 5.5.x 中的变更</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="migration55.new-features.html">新的特性</a></div>
 <div class="up"><a href="migration55.html">从 PHP 5.4.x 迁移到 PHP 5.5.x</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
